<?php
/**
 * Created by PhpStorm.
 * User: liuhong
 * Date: 2019-04-09
 * Time: 16:01
 */

namespace app\service;


use app\model\MallConfigModel;
use think\Db;
use think\Exception;
use think\Model;

/**
 * 分公司配置项
 * Class MallConfigService
 * @package app\service
 */
class MallConfigService extends BaseService
{
    public $mallConfigModel;

    public function __construct()
    {
        $this->mallConfigModel=new MallConfigModel();
    }

    /**
     * 新增/编辑
     * @param $add
     * @param null $id
     * @return false|int
     */
    public function add($add,$id=null){
        if(empty($id)){
            return $this->mallConfigModel->insertGetId($add);
        }else{
            return $this->mallConfigModel->save($add,array('id'=>$id));
        }
    }


}